<template>
    <div class="container w-full h-full flex justify-center items-center">
        <div class="box mt-10 p-10 rounded-md text-center">
            成功退出! {{ second }}秒后跳转到 <router-link to="/login">登录</router-link>页面

        </div>
    </div>
</template>
<script setup>
import { useRouter } from 'vue-router'
import useUseInfo from '@/store/user'
import { onMounted } from 'vue';
const userInfo = useUseInfo()

const router = useRouter()
const second = ref(30)
onMounted(() => {
    userInfo.data.token = ''
    userInfo.data.user = {}
    const timer = setInterval(() => {
        second.value--
        if (second.value === 0) {
            clearInterval(timer)
            router.push('/login')
        }

    }, 1000)
})


</script>